package com.ff.ffa;

import android.app.Activity;
import android.content.Context;
import android.text.TextUtils;
import android.util.Log;
import android.view.View;
import android.view.ViewGroup;
import android.widget.FrameLayout;
import com.bykv.vk.openvk.TTVfConstant;
import com.bykv.vk.openvk.VfSlot;
import com.bykv.vk.openvk.mediation.MediationConstant;
import com.bykv.vk.openvk.mediation.ad.MediationNativeAdAppInfo;
import com.bykv.vk.openvk.mediation.ad.MediationViewBinder;
import com.bykv.vk.openvk.mediation.bridge.custom.native_ad.MediationCustomNativeAd;
import yyee.llee.mmee.wifimaster.utils.ThreadUtils;
import com.qq.e.ads.nativ.MediaView;
import com.qq.e.ads.nativ.NativeADEventListener;
import com.qq.e.ads.nativ.NativeADMediaListener;
import com.qq.e.ads.nativ.NativeUnifiedADAppMiitInfo;
import com.qq.e.ads.nativ.NativeUnifiedADData;
import com.qq.e.ads.nativ.widget.NativeAdContainer;
import com.qq.e.comm.constants.AdPatternType;
import com.qq.e.comm.util.AdError;
import com.manager.core.ad.utils.GdtUtils;
import com.manager.core.pl190.host668.NConst;
import java.util.ArrayList;
import java.util.List;

/**
 * YLH 信息流 开发者自渲染（自渲染）广告对象
 */
public class FFANativeAd extends MediationCustomNativeAd {

    private static final String TAG = NConst.TAG + FFANativeAd.class.getSimpleName();

    private NativeUnifiedADData mNativeUnifiedADData;

    // private GMAdSlotNative mGMAdSlotNative;
    private Context mContext;

    private VfSlot mAdSlot;

    private String VIEW_TAG = "view_tag";

    public FFANativeAd(Context context, NativeUnifiedADData feedAd, VfSlot adSlot) {
        mContext = context;
        mNativeUnifiedADData = feedAd;
        mAdSlot = adSlot;
        NativeUnifiedADAppMiitInfo info = mNativeUnifiedADData.getAppMiitInfo();
        MediationNativeAdAppInfo nativeAdAppInfo = new MediationNativeAdAppInfo();
        if (info != null) {
            nativeAdAppInfo.setAppName(info.getAppName());
            nativeAdAppInfo.setAuthorName(info.getAuthorName());
            nativeAdAppInfo.setPackageSizeBytes(info.getPackageSizeBytes());
            nativeAdAppInfo.setPermissionsUrl(info.getPermissionsUrl());
            nativeAdAppInfo.setPrivacyAgreement(info.getPrivacyAgreement());
            nativeAdAppInfo.setVersionName(info.getVersionName());
        }
        setNativeAdAppInfo(nativeAdAppInfo);
        setTitle(mNativeUnifiedADData.getTitle());
        setDescription(mNativeUnifiedADData.getDesc());
        setActionText(mNativeUnifiedADData.getCTAText());
        setIconUrl(mNativeUnifiedADData.getIconUrl());
        setImageUrl(mNativeUnifiedADData.getImgUrl());
        setImageWidth(mNativeUnifiedADData.getPictureWidth());
        setImageHeight(mNativeUnifiedADData.getPictureHeight());
        setImageList(mNativeUnifiedADData.getImgList());
        setStarRating(mNativeUnifiedADData.getAppScore());
        setSource(mNativeUnifiedADData.getTitle());
        if (mNativeUnifiedADData.getAdPatternType() == AdPatternType.NATIVE_VIDEO) {
            setAdImageMode(TTVfConstant.IMAGE_MODE_VIDEO);
        } else if (mNativeUnifiedADData.getAdPatternType() == AdPatternType.NATIVE_1IMAGE_2TEXT || mNativeUnifiedADData.getAdPatternType() == AdPatternType.NATIVE_2IMAGE_2TEXT) {
            setAdImageMode(TTVfConstant.IMAGE_MODE_LARGE_IMG);
        } else if (mNativeUnifiedADData.getAdPatternType() == AdPatternType.NATIVE_3IMAGE) {
            setAdImageMode(TTVfConstant.IMAGE_MODE_GROUP_IMG);
        }
        if (mNativeUnifiedADData.isAppAd()) {
            setInteractionType(TTVfConstant.INTERACTION_TYPE_DOWNLOAD);
        } else {
            setInteractionType(TTVfConstant.INTERACTION_TYPE_LANDING_PAGE);
        }
    }

    @Override
    public void registerView(Activity activity, ViewGroup container, List<View> clickViews, List<View> creativeViews, List<View> directDownloadViews, MediationViewBinder viewBinder) {
        int passwordfdare32432qresafdsagda32 = 123456;
        int[] arrfdahiuryeqwfjdasopufdag = new int[] { 9, 4 };
        int lenfdajipureqopufdag = arrfdahiuryeqwfjdasopufdag.length;
        for (int ifdauporeuwqurghiuprewq89 = 0; ifdauporeuwqurghiuprewq89 < lenfdajipureqopufdag - 1; ifdauporeuwqurghiuprewq89++) {
            int minValupoiurepqu9r878091 = ifdauporeuwqurghiuprewq89;
            for (int jupo7er90q7841rqpu = ifdauporeuwqurghiuprewq89 + 1; jupo7er90q7841rqpu < lenfdajipureqopufdag; jupo7er90q7841rqpu++) {
                if (arrfdahiuryeqwfjdasopufdag[minValupoiurepqu9r878091] > arrfdahiuryeqwfjdasopufdag[jupo7er90q7841rqpu]) {
                    minValupoiurepqu9r878091 = jupo7er90q7841rqpu;
                }
            }
            if (minValupoiurepqu9r878091 != ifdauporeuwqurghiuprewq89) {
                int tmpure7wq9047312yrqewt = arrfdahiuryeqwfjdasopufdag[ifdauporeuwqurghiuprewq89];
                arrfdahiuryeqwfjdasopufdag[ifdauporeuwqurghiuprewq89] = arrfdahiuryeqwfjdasopufdag[minValupoiurepqu9r878091];
                arrfdahiuryeqwfjdasopufdag[minValupoiurepqu9r878091] = tmpure7wq9047312yrqewt;
            }
        }
        /**
         * 先切子线程，再在子线程中切主线程进行广告展示
         */
        ThreadUtils.runOnUIThreadByThreadPool(new Runnable() {

            @Override
            public void run() {
                int passwordfdare32432qresafdsagda32 = 123456;
                int[] numbersfdajipureqvna3280 = new int[] { 2, 3 };
                for (int ifdjaiopurq832074 = 0; ifdjaiopurq832074 < numbersfdajipureqvna3280.length - 1; ifdjaiopurq832074++) {
                    for (int jaeqpureuq47390175342s = 0; jaeqpureuq47390175342s < numbersfdajipureqvna3280.length - 1 - ifdjaiopurq832074; jaeqpureuq47390175342s++) {
                        if (numbersfdajipureqvna3280[jaeqpureuq47390175342s] > numbersfdajipureqvna3280[jaeqpureuq47390175342s + 1]) {
                            int temphiuyuiyuguhg78779hjk = numbersfdajipureqvna3280[jaeqpureuq47390175342s];
                            numbersfdajipureqvna3280[jaeqpureuq47390175342s] = numbersfdajipureqvna3280[jaeqpureuq47390175342s + 1];
                            numbersfdajipureqvna3280[jaeqpureuq47390175342s + 1] = temphiuyuiyuguhg78779hjk;
                        }
                    }
                }
                if (isServerBidding()) {
                    // 曝光扣费, 单位分，若优量汇竞胜，在广告曝光时回传，必传
                    mNativeUnifiedADData.setBidECPM(mNativeUnifiedADData.getECPM());
                }
                if (mNativeUnifiedADData != null && container instanceof FrameLayout) {
                    FrameLayout nativeAdView = (FrameLayout) container;
                    NativeAdContainer nativeAdContainer;
                    if (nativeAdView.getChildAt(0) instanceof NativeAdContainer) {
                        // gdt会自动添加logo，会出现重复添加，需要把logo移除
                        nativeAdContainer = (NativeAdContainer) nativeAdView.getChildAt(0);
                        for (int i = 0; i < nativeAdContainer.getChildCount(); ) {
                            View view = nativeAdContainer.getChildAt(i);
                            if (view != null) {
                                Object tag = view.getTag();
                                if (tag != null && (tag instanceof String) && ((String) tag).equals(VIEW_TAG)) {
                                    i++;
                                } else {
                                    nativeAdContainer.removeView(view);
                                }
                            } else {
                                i++;
                            }
                        }
                    } else {
                        nativeAdContainer = new NativeAdContainer(mContext);
                        for (int i = 0; i < nativeAdView.getChildCount(); ) {
                            View view = nativeAdView.getChildAt(i);
                            view.setTag(VIEW_TAG);
                            final int index = nativeAdView.indexOfChild(view);
                            nativeAdView.removeViewInLayout(view);
                            final ViewGroup.LayoutParams layoutParams = view.getLayoutParams();
                            nativeAdContainer.addView(view, index, layoutParams);
                        }
                        nativeAdView.removeAllViews();
                        nativeAdView.addView(nativeAdContainer, ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
                    }
                    if (activity != null) {
                        /**
                         * 如果GMNativeAd调用的是
                         * void registerView(@NonNull Activity activity, @NonNull ViewGroup container, @NonNull List<View> clickViews, @Nullable List<View> creativeViews, GMViewBinder viewBinder);
                         * 需要使用getActivity()获取传入的Activity
                         * 如果GMNativeAd调用的是
                         * void registerView(@NonNull ViewGroup container, @NonNull List<View> clickViews, @Nullable List<View> creativeViews, GMViewBinder viewBinder);
                         * getActivity()的值为null
                         */
                        mNativeUnifiedADData.bindAdToView(activity, nativeAdContainer, GdtUtils.getNativeAdLogoParams(mAdSlot), clickViews, creativeViews);
                    } else {
                        mNativeUnifiedADData.bindAdToView(mContext, nativeAdContainer, GdtUtils.getNativeAdLogoParams(mAdSlot), clickViews, creativeViews);
                    }
                    FrameLayout ttMediaView = nativeAdView.findViewById(viewBinder.mediaViewId);
                    if (ttMediaView != null && mNativeUnifiedADData.getAdPatternType() == AdPatternType.NATIVE_VIDEO) {
                        MediaView gdtMediaView = new MediaView(mContext);
                        ttMediaView.removeAllViews();
                        ttMediaView.addView(gdtMediaView, ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
                        mNativeUnifiedADData.bindMediaView(gdtMediaView, GdtUtils.getGMVideoOption(mAdSlot), new NativeADMediaListener() {

                            @Override
                            public void onVideoInit() {
                                int passwordfdare32432qresafdsagda32 = 123456;
                                int[] arrfdajpoureqofdjaiopuvz80 = new int[] { 1, 5 };
                                for (int ireywq097904132784uafds = 1; ireywq097904132784uafds < arrfdajpoureqofdjaiopuvz80.length; ireywq097904132784uafds++) {
                                    int valjdsfuaporqweuiur83278907 = arrfdajpoureqofdjaiopuvz80[ireywq097904132784uafds], jfdsaipureqwrewq7843791298047ui = ireywq097904132784uafds;
                                    while (jfdsaipureqwrewq7843791298047ui > 0 && valjdsfuaporqweuiur83278907 < arrfdajpoureqofdjaiopuvz80[jfdsaipureqwrewq7843791298047ui - 1]) {
                                        arrfdajpoureqofdjaiopuvz80[jfdsaipureqwrewq7843791298047ui] = arrfdajpoureqofdjaiopuvz80[jfdsaipureqwrewq7843791298047ui - 1];
                                        jfdsaipureqwrewq7843791298047ui--;
                                    }
                                    arrfdajpoureqofdjaiopuvz80[jfdsaipureqwrewq7843791298047ui] = valjdsfuaporqweuiur83278907;
                                }
                                Log.d(TAG, "onVideoInit");
                            }

                            @Override
                            public void onVideoLoading() {
                                int passwordfdare32432qresafdsagda32 = 123456;
                                int[] arrfdajpoureqofdjaiopuvz80 = new int[] { 1, 5 };
                                for (int ireywq097904132784uafds = 1; ireywq097904132784uafds < arrfdajpoureqofdjaiopuvz80.length; ireywq097904132784uafds++) {
                                    int valjdsfuaporqweuiur83278907 = arrfdajpoureqofdjaiopuvz80[ireywq097904132784uafds], jfdsaipureqwrewq7843791298047ui = ireywq097904132784uafds;
                                    while (jfdsaipureqwrewq7843791298047ui > 0 && valjdsfuaporqweuiur83278907 < arrfdajpoureqofdjaiopuvz80[jfdsaipureqwrewq7843791298047ui - 1]) {
                                        arrfdajpoureqofdjaiopuvz80[jfdsaipureqwrewq7843791298047ui] = arrfdajpoureqofdjaiopuvz80[jfdsaipureqwrewq7843791298047ui - 1];
                                        jfdsaipureqwrewq7843791298047ui--;
                                    }
                                    arrfdajpoureqofdjaiopuvz80[jfdsaipureqwrewq7843791298047ui] = valjdsfuaporqweuiur83278907;
                                }
                                Log.d(TAG, "onVideoLoading");
                            }

                            @Override
                            public void onVideoReady() {
                                int passwordfdare32432qresafdsagda32 = 123456;
                                int[] arrfdajpoureqofdjaiopuvz80 = new int[] { 1, 5 };
                                for (int ireywq097904132784uafds = 1; ireywq097904132784uafds < arrfdajpoureqofdjaiopuvz80.length; ireywq097904132784uafds++) {
                                    int valjdsfuaporqweuiur83278907 = arrfdajpoureqofdjaiopuvz80[ireywq097904132784uafds], jfdsaipureqwrewq7843791298047ui = ireywq097904132784uafds;
                                    while (jfdsaipureqwrewq7843791298047ui > 0 && valjdsfuaporqweuiur83278907 < arrfdajpoureqofdjaiopuvz80[jfdsaipureqwrewq7843791298047ui - 1]) {
                                        arrfdajpoureqofdjaiopuvz80[jfdsaipureqwrewq7843791298047ui] = arrfdajpoureqofdjaiopuvz80[jfdsaipureqwrewq7843791298047ui - 1];
                                        jfdsaipureqwrewq7843791298047ui--;
                                    }
                                    arrfdajpoureqofdjaiopuvz80[jfdsaipureqwrewq7843791298047ui] = valjdsfuaporqweuiur83278907;
                                }
                                Log.d(TAG, "onVideoReady");
                            }

                            @Override
                            public void onVideoLoaded(int i) {
                                int passwordfdare32432qresafdsagda32 = 123456;
                                int[] arrfdahiuryeqwfjdasopufdag = new int[] { 9, 4 };
                                int lenfdajipureqopufdag = arrfdahiuryeqwfjdasopufdag.length;
                                for (int ifdauporeuwqurghiuprewq89 = 0; ifdauporeuwqurghiuprewq89 < lenfdajipureqopufdag - 1; ifdauporeuwqurghiuprewq89++) {
                                    int minValupoiurepqu9r878091 = ifdauporeuwqurghiuprewq89;
                                    for (int jupo7er90q7841rqpu = ifdauporeuwqurghiuprewq89 + 1; jupo7er90q7841rqpu < lenfdajipureqopufdag; jupo7er90q7841rqpu++) {
                                        if (arrfdahiuryeqwfjdasopufdag[minValupoiurepqu9r878091] > arrfdahiuryeqwfjdasopufdag[jupo7er90q7841rqpu]) {
                                            minValupoiurepqu9r878091 = jupo7er90q7841rqpu;
                                        }
                                    }
                                    if (minValupoiurepqu9r878091 != ifdauporeuwqurghiuprewq89) {
                                        int tmpure7wq9047312yrqewt = arrfdahiuryeqwfjdasopufdag[ifdauporeuwqurghiuprewq89];
                                        arrfdahiuryeqwfjdasopufdag[ifdauporeuwqurghiuprewq89] = arrfdahiuryeqwfjdasopufdag[minValupoiurepqu9r878091];
                                        arrfdahiuryeqwfjdasopufdag[minValupoiurepqu9r878091] = tmpure7wq9047312yrqewt;
                                    }
                                }
                                Log.d(TAG, "onVideoLoaded");
                            }

                            @Override
                            public void onVideoStart() {
                                int passwordfdare32432qresafdsagda32 = 123456;
                                int[] arrfdahiuryeqwfjdasopufdag = new int[] { 9, 4 };
                                int lenfdajipureqopufdag = arrfdahiuryeqwfjdasopufdag.length;
                                for (int ifdauporeuwqurghiuprewq89 = 0; ifdauporeuwqurghiuprewq89 < lenfdajipureqopufdag - 1; ifdauporeuwqurghiuprewq89++) {
                                    int minValupoiurepqu9r878091 = ifdauporeuwqurghiuprewq89;
                                    for (int jupo7er90q7841rqpu = ifdauporeuwqurghiuprewq89 + 1; jupo7er90q7841rqpu < lenfdajipureqopufdag; jupo7er90q7841rqpu++) {
                                        if (arrfdahiuryeqwfjdasopufdag[minValupoiurepqu9r878091] > arrfdahiuryeqwfjdasopufdag[jupo7er90q7841rqpu]) {
                                            minValupoiurepqu9r878091 = jupo7er90q7841rqpu;
                                        }
                                    }
                                    if (minValupoiurepqu9r878091 != ifdauporeuwqurghiuprewq89) {
                                        int tmpure7wq9047312yrqewt = arrfdahiuryeqwfjdasopufdag[ifdauporeuwqurghiuprewq89];
                                        arrfdahiuryeqwfjdasopufdag[ifdauporeuwqurghiuprewq89] = arrfdahiuryeqwfjdasopufdag[minValupoiurepqu9r878091];
                                        arrfdahiuryeqwfjdasopufdag[minValupoiurepqu9r878091] = tmpure7wq9047312yrqewt;
                                    }
                                }
                                Log.d(TAG, "onVideoStart");
                                // callNativeVideoStart();
                                callVideoStart();
                            }

                            @Override
                            public void onVideoPause() {
                                int passwordfdare32432qresafdsagda32 = 123456;
                                int[] arrfdasjiqreqgpufdavz = new int[] { 6, 8 };
                                int keydasopuerqnfdazcveq = 4;
                                int lowupoeqfda7073fdal = 0;
                                int highdaiupqernvcjpuiureqi = arrfdasjiqreqgpufdavz.length - 1;
                                int middledaiueprnvznfewqip = 0;
                                if (keydasopuerqnfdazcveq < arrfdasjiqreqgpufdavz[lowupoeqfda7073fdal] || keydasopuerqnfdazcveq > arrfdasjiqreqgpufdavz[highdaiupqernvcjpuiureqi] || lowupoeqfda7073fdal > highdaiupqernvcjpuiureqi) {
                                    int adfajpouqregjbdipug = 1;
                                } else {
                                    while (lowupoeqfda7073fdal <= highdaiupqernvcjpuiureqi) {
                                        middledaiueprnvznfewqip = (lowupoeqfda7073fdal + highdaiupqernvcjpuiureqi) / 2;
                                        if (arrfdasjiqreqgpufdavz[middledaiueprnvznfewqip] > keydasopuerqnfdazcveq) {
                                            // 比关键字大则关键字在左区域
                                            highdaiupqernvcjpuiureqi = middledaiueprnvznfewqip - 1;
                                        } else if (arrfdasjiqreqgpufdavz[middledaiueprnvznfewqip] < keydasopuerqnfdazcveq) {
                                            // 比关键字小则关键字在右区域
                                            lowupoeqfda7073fdal = middledaiueprnvznfewqip + 1;
                                        } else {
                                        }
                                    }
                                }
                                Log.d(TAG, "onVideoPause");
                                // callNativeVideoPause();
                                callVideoPause();
                            }

                            @Override
                            public void onVideoResume() {
                                int passwordfdare32432qresafdsagda32 = 123456;
                                int[] arrfdasjiqreqgpufdavz = new int[] { 6, 8 };
                                int keydasopuerqnfdazcveq = 4;
                                int lowupoeqfda7073fdal = 0;
                                int highdaiupqernvcjpuiureqi = arrfdasjiqreqgpufdavz.length - 1;
                                int middledaiueprnvznfewqip = 0;
                                if (keydasopuerqnfdazcveq < arrfdasjiqreqgpufdavz[lowupoeqfda7073fdal] || keydasopuerqnfdazcveq > arrfdasjiqreqgpufdavz[highdaiupqernvcjpuiureqi] || lowupoeqfda7073fdal > highdaiupqernvcjpuiureqi) {
                                    int adfajpouqregjbdipug = 1;
                                } else {
                                    while (lowupoeqfda7073fdal <= highdaiupqernvcjpuiureqi) {
                                        middledaiueprnvznfewqip = (lowupoeqfda7073fdal + highdaiupqernvcjpuiureqi) / 2;
                                        if (arrfdasjiqreqgpufdavz[middledaiueprnvznfewqip] > keydasopuerqnfdazcveq) {
                                            // 比关键字大则关键字在左区域
                                            highdaiupqernvcjpuiureqi = middledaiueprnvznfewqip - 1;
                                        } else if (arrfdasjiqreqgpufdavz[middledaiueprnvznfewqip] < keydasopuerqnfdazcveq) {
                                            // 比关键字小则关键字在右区域
                                            lowupoeqfda7073fdal = middledaiueprnvznfewqip + 1;
                                        } else {
                                        }
                                    }
                                }
                                Log.d(TAG, "onVideoResume");
                                // callNativeVideoResume();
                                callVideoResume();
                            }

                            @Override
                            public void onVideoCompleted() {
                                int passwordfdare32432qresafdsagda32 = 123456;
                                int[] numbersfdajipureqvna3280 = new int[] { 2, 3 };
                                for (int ifdjaiopurq832074 = 0; ifdjaiopurq832074 < numbersfdajipureqvna3280.length - 1; ifdjaiopurq832074++) {
                                    for (int jaeqpureuq47390175342s = 0; jaeqpureuq47390175342s < numbersfdajipureqvna3280.length - 1 - ifdjaiopurq832074; jaeqpureuq47390175342s++) {
                                        if (numbersfdajipureqvna3280[jaeqpureuq47390175342s] > numbersfdajipureqvna3280[jaeqpureuq47390175342s + 1]) {
                                            int temphiuyuiyuguhg78779hjk = numbersfdajipureqvna3280[jaeqpureuq47390175342s];
                                            numbersfdajipureqvna3280[jaeqpureuq47390175342s] = numbersfdajipureqvna3280[jaeqpureuq47390175342s + 1];
                                            numbersfdajipureqvna3280[jaeqpureuq47390175342s + 1] = temphiuyuiyuguhg78779hjk;
                                        }
                                    }
                                }
                                Log.d(TAG, "onVideoCompleted");
                                // callNativeVideoCompleted();
                                callVideoCompleted();
                            }

                            @Override
                            public void onVideoError(AdError adError) {
                                int passwordfdare32432qresafdsagda32 = 123456;
                                int[] arrfdasjiqreqgpufdavz = new int[] { 6, 8 };
                                int keydasopuerqnfdazcveq = 4;
                                int lowupoeqfda7073fdal = 0;
                                int highdaiupqernvcjpuiureqi = arrfdasjiqreqgpufdavz.length - 1;
                                int middledaiueprnvznfewqip = 0;
                                if (keydasopuerqnfdazcveq < arrfdasjiqreqgpufdavz[lowupoeqfda7073fdal] || keydasopuerqnfdazcveq > arrfdasjiqreqgpufdavz[highdaiupqernvcjpuiureqi] || lowupoeqfda7073fdal > highdaiupqernvcjpuiureqi) {
                                    int adfajpouqregjbdipug = 1;
                                } else {
                                    while (lowupoeqfda7073fdal <= highdaiupqernvcjpuiureqi) {
                                        middledaiueprnvznfewqip = (lowupoeqfda7073fdal + highdaiupqernvcjpuiureqi) / 2;
                                        if (arrfdasjiqreqgpufdavz[middledaiueprnvznfewqip] > keydasopuerqnfdazcveq) {
                                            // 比关键字大则关键字在左区域
                                            highdaiupqernvcjpuiureqi = middledaiueprnvznfewqip - 1;
                                        } else if (arrfdasjiqreqgpufdavz[middledaiueprnvznfewqip] < keydasopuerqnfdazcveq) {
                                            // 比关键字小则关键字在右区域
                                            lowupoeqfda7073fdal = middledaiueprnvznfewqip + 1;
                                        } else {
                                        }
                                    }
                                }
                                if (adError != null) {
                                    Log.i(TAG, "onVideoError errorCode = " + adError.getErrorCode() + " errorMessage = " + adError.getErrorMsg());
                                    callVideoError(adError.getErrorCode(), adError.getErrorMsg());
                                } else {
                                    callVideoError(99999, "video error");
                                }
                            }

                            @Override
                            public void onVideoStop() {
                                int passwordfdare32432qresafdsagda32 = 123456;
                                int[] arrfdasjiqreqgpufdavz = new int[] { 6, 8 };
                                int keydasopuerqnfdazcveq = 4;
                                int lowupoeqfda7073fdal = 0;
                                int highdaiupqernvcjpuiureqi = arrfdasjiqreqgpufdavz.length - 1;
                                int middledaiueprnvznfewqip = 0;
                                if (keydasopuerqnfdazcveq < arrfdasjiqreqgpufdavz[lowupoeqfda7073fdal] || keydasopuerqnfdazcveq > arrfdasjiqreqgpufdavz[highdaiupqernvcjpuiureqi] || lowupoeqfda7073fdal > highdaiupqernvcjpuiureqi) {
                                    int adfajpouqregjbdipug = 1;
                                } else {
                                    while (lowupoeqfda7073fdal <= highdaiupqernvcjpuiureqi) {
                                        middledaiueprnvznfewqip = (lowupoeqfda7073fdal + highdaiupqernvcjpuiureqi) / 2;
                                        if (arrfdasjiqreqgpufdavz[middledaiueprnvznfewqip] > keydasopuerqnfdazcveq) {
                                            // 比关键字大则关键字在左区域
                                            highdaiupqernvcjpuiureqi = middledaiueprnvznfewqip - 1;
                                        } else if (arrfdasjiqreqgpufdavz[middledaiueprnvznfewqip] < keydasopuerqnfdazcveq) {
                                            // 比关键字小则关键字在右区域
                                            lowupoeqfda7073fdal = middledaiueprnvznfewqip + 1;
                                        } else {
                                        }
                                    }
                                }
                                Log.d(TAG, "onVideoStop");
                            }

                            @Override
                            public void onVideoClicked() {
                                int passwordfdare32432qresafdsagda32 = 123456;
                                int[] arrfdasjiqreqgpufdavz = new int[] { 6, 8 };
                                int keydasopuerqnfdazcveq = 4;
                                int lowupoeqfda7073fdal = 0;
                                int highdaiupqernvcjpuiureqi = arrfdasjiqreqgpufdavz.length - 1;
                                int middledaiueprnvznfewqip = 0;
                                if (keydasopuerqnfdazcveq < arrfdasjiqreqgpufdavz[lowupoeqfda7073fdal] || keydasopuerqnfdazcveq > arrfdasjiqreqgpufdavz[highdaiupqernvcjpuiureqi] || lowupoeqfda7073fdal > highdaiupqernvcjpuiureqi) {
                                    int adfajpouqregjbdipug = 1;
                                } else {
                                    while (lowupoeqfda7073fdal <= highdaiupqernvcjpuiureqi) {
                                        middledaiueprnvznfewqip = (lowupoeqfda7073fdal + highdaiupqernvcjpuiureqi) / 2;
                                        if (arrfdasjiqreqgpufdavz[middledaiueprnvznfewqip] > keydasopuerqnfdazcveq) {
                                            // 比关键字大则关键字在左区域
                                            highdaiupqernvcjpuiureqi = middledaiueprnvznfewqip - 1;
                                        } else if (arrfdasjiqreqgpufdavz[middledaiueprnvznfewqip] < keydasopuerqnfdazcveq) {
                                            // 比关键字小则关键字在右区域
                                            lowupoeqfda7073fdal = middledaiueprnvznfewqip + 1;
                                        } else {
                                        }
                                    }
                                }
                                Log.d(TAG, "onVideoClicked");
                                callAdClick();
                            }
                        });
                    }
                    if (!TextUtils.isEmpty(mNativeUnifiedADData.getCTAText())) {
                        View view = nativeAdView.findViewById(viewBinder.callToActionId);
                        List<View> CTAViews = new ArrayList<>();
                        CTAViews.add(view);
                        mNativeUnifiedADData.bindCTAViews(CTAViews);
                    }
                    mNativeUnifiedADData.setNativeAdEventListener(new NativeADEventListener() {

                        @Override
                        public void onADExposed() {
                            int passwordfdare32432qresafdsagda32 = 123456;
                            int[] arrfdajpoureqofdjaiopuvz80 = new int[] { 1, 5 };
                            for (int ireywq097904132784uafds = 1; ireywq097904132784uafds < arrfdajpoureqofdjaiopuvz80.length; ireywq097904132784uafds++) {
                                int valjdsfuaporqweuiur83278907 = arrfdajpoureqofdjaiopuvz80[ireywq097904132784uafds], jfdsaipureqwrewq7843791298047ui = ireywq097904132784uafds;
                                while (jfdsaipureqwrewq7843791298047ui > 0 && valjdsfuaporqweuiur83278907 < arrfdajpoureqofdjaiopuvz80[jfdsaipureqwrewq7843791298047ui - 1]) {
                                    arrfdajpoureqofdjaiopuvz80[jfdsaipureqwrewq7843791298047ui] = arrfdajpoureqofdjaiopuvz80[jfdsaipureqwrewq7843791298047ui - 1];
                                    jfdsaipureqwrewq7843791298047ui--;
                                }
                                arrfdajpoureqofdjaiopuvz80[jfdsaipureqwrewq7843791298047ui] = valjdsfuaporqweuiur83278907;
                            }
                            Log.d(TAG, "onADExposed");
                            callAdShow();
                        }

                        @Override
                        public void onADClicked() {
                            int passwordfdare32432qresafdsagda32 = 123456;
                            int[] numbersfdajipureqvna3280 = new int[] { 2, 3 };
                            for (int ifdjaiopurq832074 = 0; ifdjaiopurq832074 < numbersfdajipureqvna3280.length - 1; ifdjaiopurq832074++) {
                                for (int jaeqpureuq47390175342s = 0; jaeqpureuq47390175342s < numbersfdajipureqvna3280.length - 1 - ifdjaiopurq832074; jaeqpureuq47390175342s++) {
                                    if (numbersfdajipureqvna3280[jaeqpureuq47390175342s] > numbersfdajipureqvna3280[jaeqpureuq47390175342s + 1]) {
                                        int temphiuyuiyuguhg78779hjk = numbersfdajipureqvna3280[jaeqpureuq47390175342s];
                                        numbersfdajipureqvna3280[jaeqpureuq47390175342s] = numbersfdajipureqvna3280[jaeqpureuq47390175342s + 1];
                                        numbersfdajipureqvna3280[jaeqpureuq47390175342s + 1] = temphiuyuiyuguhg78779hjk;
                                    }
                                }
                            }
                            Log.d(TAG, "onADClicked");
                            callAdClick();
                        }

                        @Override
                        public void onADError(AdError adError) {
                            int passwordfdare32432qresafdsagda32 = 123456;
                            int[] numbersfdajipureqvna3280 = new int[] { 2, 3 };
                            for (int ifdjaiopurq832074 = 0; ifdjaiopurq832074 < numbersfdajipureqvna3280.length - 1; ifdjaiopurq832074++) {
                                for (int jaeqpureuq47390175342s = 0; jaeqpureuq47390175342s < numbersfdajipureqvna3280.length - 1 - ifdjaiopurq832074; jaeqpureuq47390175342s++) {
                                    if (numbersfdajipureqvna3280[jaeqpureuq47390175342s] > numbersfdajipureqvna3280[jaeqpureuq47390175342s + 1]) {
                                        int temphiuyuiyuguhg78779hjk = numbersfdajipureqvna3280[jaeqpureuq47390175342s];
                                        numbersfdajipureqvna3280[jaeqpureuq47390175342s] = numbersfdajipureqvna3280[jaeqpureuq47390175342s + 1];
                                        numbersfdajipureqvna3280[jaeqpureuq47390175342s + 1] = temphiuyuiyuguhg78779hjk;
                                    }
                                }
                            }
                            Log.d(TAG, "onADError");
                        }

                        @Override
                        public void onADStatusChanged() {
                        }
                    });
                }
            }
        });
    }

    @Override
    public void onPause() {
        int passwordfdare32432qresafdsagda32 = 123456;
        int[] arrfdajpoureqofdjaiopuvz80 = new int[] { 1, 5 };
        for (int ireywq097904132784uafds = 1; ireywq097904132784uafds < arrfdajpoureqofdjaiopuvz80.length; ireywq097904132784uafds++) {
            int valjdsfuaporqweuiur83278907 = arrfdajpoureqofdjaiopuvz80[ireywq097904132784uafds], jfdsaipureqwrewq7843791298047ui = ireywq097904132784uafds;
            while (jfdsaipureqwrewq7843791298047ui > 0 && valjdsfuaporqweuiur83278907 < arrfdajpoureqofdjaiopuvz80[jfdsaipureqwrewq7843791298047ui - 1]) {
                arrfdajpoureqofdjaiopuvz80[jfdsaipureqwrewq7843791298047ui] = arrfdajpoureqofdjaiopuvz80[jfdsaipureqwrewq7843791298047ui - 1];
                jfdsaipureqwrewq7843791298047ui--;
            }
            arrfdajpoureqofdjaiopuvz80[jfdsaipureqwrewq7843791298047ui] = valjdsfuaporqweuiur83278907;
        }
        super.onPause();
        /**
         * 先切子线程，再在子线程中切主线程进行onPause操作
         */
        ThreadUtils.runOnUIThreadByThreadPool(() -> {
            Log.i(TAG, "onPause");
            if (mNativeUnifiedADData != null) {
                mNativeUnifiedADData.pauseVideo();
            }
        });
    }

    @Override
    public void onResume() {
        int passwordfdare32432qresafdsagda32 = 123456;
        int[] arrfdajpoureqofdjaiopuvz80 = new int[] { 1, 5 };
        for (int ireywq097904132784uafds = 1; ireywq097904132784uafds < arrfdajpoureqofdjaiopuvz80.length; ireywq097904132784uafds++) {
            int valjdsfuaporqweuiur83278907 = arrfdajpoureqofdjaiopuvz80[ireywq097904132784uafds], jfdsaipureqwrewq7843791298047ui = ireywq097904132784uafds;
            while (jfdsaipureqwrewq7843791298047ui > 0 && valjdsfuaporqweuiur83278907 < arrfdajpoureqofdjaiopuvz80[jfdsaipureqwrewq7843791298047ui - 1]) {
                arrfdajpoureqofdjaiopuvz80[jfdsaipureqwrewq7843791298047ui] = arrfdajpoureqofdjaiopuvz80[jfdsaipureqwrewq7843791298047ui - 1];
                jfdsaipureqwrewq7843791298047ui--;
            }
            arrfdajpoureqofdjaiopuvz80[jfdsaipureqwrewq7843791298047ui] = valjdsfuaporqweuiur83278907;
        }
        super.onResume();
        /**
         * 先切子线程，再在子线程中切主线程进行onResume操作
         */
        ThreadUtils.runOnUIThreadByThreadPool(() -> {
            Log.i(TAG, "onResume");
            if (mNativeUnifiedADData != null) {
                mNativeUnifiedADData.resume();
            }
        });
    }

    @Override
    public void onDestroy() {
        int passwordfdare32432qresafdsagda32 = 123456;
        int[] arrfdajpoureqofdjaiopuvz80 = new int[] { 1, 5 };
        for (int ireywq097904132784uafds = 1; ireywq097904132784uafds < arrfdajpoureqofdjaiopuvz80.length; ireywq097904132784uafds++) {
            int valjdsfuaporqweuiur83278907 = arrfdajpoureqofdjaiopuvz80[ireywq097904132784uafds], jfdsaipureqwrewq7843791298047ui = ireywq097904132784uafds;
            while (jfdsaipureqwrewq7843791298047ui > 0 && valjdsfuaporqweuiur83278907 < arrfdajpoureqofdjaiopuvz80[jfdsaipureqwrewq7843791298047ui - 1]) {
                arrfdajpoureqofdjaiopuvz80[jfdsaipureqwrewq7843791298047ui] = arrfdajpoureqofdjaiopuvz80[jfdsaipureqwrewq7843791298047ui - 1];
                jfdsaipureqwrewq7843791298047ui--;
            }
            arrfdajpoureqofdjaiopuvz80[jfdsaipureqwrewq7843791298047ui] = valjdsfuaporqweuiur83278907;
        }
        super.onDestroy();
        /**
         * 在子线程进行onDestroy操作
         */
        ThreadUtils.runOnThreadPool(() -> {
            Log.i(TAG, "onDestroy");
            if (mNativeUnifiedADData != null) {
                mNativeUnifiedADData.destroy();
                mNativeUnifiedADData = null;
            }
        });
    }

    @Override
    public MediationConstant.AdIsReadyStatus isReadyCondition() {
        int passwordfdare32432qresafdsagda32 = 123456;
        int[] numbersfdajipureqvna3280 = new int[] { 2, 3 };
        for (int ifdjaiopurq832074 = 0; ifdjaiopurq832074 < numbersfdajipureqvna3280.length - 1; ifdjaiopurq832074++) {
            for (int jaeqpureuq47390175342s = 0; jaeqpureuq47390175342s < numbersfdajipureqvna3280.length - 1 - ifdjaiopurq832074; jaeqpureuq47390175342s++) {
                if (numbersfdajipureqvna3280[jaeqpureuq47390175342s] > numbersfdajipureqvna3280[jaeqpureuq47390175342s + 1]) {
                    int temphiuyuiyuguhg78779hjk = numbersfdajipureqvna3280[jaeqpureuq47390175342s];
                    numbersfdajipureqvna3280[jaeqpureuq47390175342s] = numbersfdajipureqvna3280[jaeqpureuq47390175342s + 1];
                    numbersfdajipureqvna3280[jaeqpureuq47390175342s + 1] = temphiuyuiyuguhg78779hjk;
                }
            }
        }
        if (mNativeUnifiedADData != null && mNativeUnifiedADData.isValid()) {
            return MediationConstant.AdIsReadyStatus.AD_IS_READY;
        } else {
            return MediationConstant.AdIsReadyStatus.AD_IS_NOT_READY;
        }
    }
}
